Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: reduce amount of scalac dependencies #2048

Merged
merged 1 commit into from
Aug 25, 2024

Conversation

bjaglin
Copy link
Collaborator

@bjaglin bjaglin commented Aug 24, 2024

Follows #2047 / scalameta/scalameta#3747

See initial discussion in #2024 (comment)

I initially tried to inline everything that was needed from semanticdb-scalac-core, but I ended up pulling pretty much everything.... It's not a big difference compared to before anyway, as the Scala 2 compiler is brought by scalameta (the main artifact). As discussed in one of the comment, that logic will have to be revisited anyway to better support Scala 3 (#2049), so I am not sure it's worth investing time on that now.

@@ -0,0 +1,10 @@
package scala.meta.internal.symtab
Copy link
Collaborator Author

@bjaglin bjaglin Aug 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/scalameta/scalameta/blob/v4.9.9/semanticdb/scalac/library/src/main/scala/scala/meta/internal/symtab/SymbolTable.scala

I am not super happy about this hack, since eventual drift between this version and the upstream one will cause runtime errors in reflect and cli, but for the foreseeable future tests should pick that up and I think it's worth it to keep core clean until we contractualize with scalameta what could be exposed as a public API.

@@ -41,6 +41,7 @@ object Dependencies {
val scalatest = "org.scalatest" %% "scalatest" % scalatestV
val munit = "org.scalameta" %% "munit" % munitV
val semanticdbScalacCore = "org.scalameta" % "semanticdb-scalac-core" % scalametaV cross CrossVersion.full
val semanticdbSharedFor3Use2_13 = "org.scalameta" % "semanticdb-shared" % scalametaV cross CrossVersion.for3Use2_13
Copy link
Collaborator Author

@bjaglin bjaglin Aug 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -149,6 +148,7 @@ lazy val reflect = projectMatrix
moduleName := "scalafix-reflect",
isFullCrossVersion,
libraryDependencies ++= Seq(
semanticdbScalacCore,
Copy link
Collaborator Author

@bjaglin bjaglin Aug 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this PR, but this change highlights a limitation: I wonder how much of the current implementation of GlobalSymbolTable works against class files produced by dotty.... We haven't got any issue but I guess it's just because the Symbol lookup API is not used much on symbols that are not in the document, or maybe it's mostly on Java and Scala standard library classes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bjaglin bjaglin marked this pull request as ready for review August 24, 2024 23:41
@bjaglin bjaglin changed the title core: reduce amount of semanticdb dependencies core: reduce amount of scalac dependencies Aug 25, 2024
@bjaglin bjaglin merged commit d21c19c into scalacenter:main Aug 25, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant